package com.yunhe.common.model.device;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yunhe.common.model.base.EnergyUnitType;

import java.util.Date;

/**
 * 能量单元对象
 * @author liuronglei
 */
public class EnergyUnit implements Comparable<EnergyUnit> {

    private Long id;
    private Long code;
    private String name;
    private String title;
    private Double capacity;
    private EnergyUnitType energyUnitType;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date productionTime;

    @Override
    public int compareTo(EnergyUnit o) {
        if (o == null) {
            return 1;
        }
        return this.getCode().compareTo(o.getCode());
    }

    public EnergyUnitType getEnergyUnitType() {
        return energyUnitType;
    }

    public void setEnergyUnitType(EnergyUnitType energyUnitType) {
        this.energyUnitType = energyUnitType;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCode() {
        return code;
    }

    public void setCode(Long code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Double getCapacity() {
        return capacity;
    }

    public void setCapacity(Double capacity) {
        this.capacity = capacity;
    }

    public Date getProductionTime() {
        return productionTime;
    }

    public void setProductionTime(Date productionTime) {
        this.productionTime = productionTime;
    }
}
